package com.hfzy.ihk.facade.calldata.enums;

import com.hfzy.ihk.common.facade.elasticsearch.entity.ElasticsearchTable;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/8/15.
 */
public enum CallDataTables implements ElasticsearchTable{

    CALL_HISTORY("CallHistory", "呼叫记录"),
    CALL_HISTORY_TEXT("CallHistoryText", "通话内容"),
    CALL_TASK_DETAIL("CallTaskDetail","呼叫任务详情");

    private CallDataTables(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private String value;

    private String desc;

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public String getTableName() {
        return value;
    }

    private static Map<String, CallDataTables> map = new HashMap<>();
    static {
        for (CallDataTables value : CallDataTables.values()) {
            map.put(value.getValue(), value);
        }
    }

    public static CallDataTables fromValue(String value) {
        CallDataTables ret = map.get(value);
        if (ret != null) {
            return ret;
        } else {
            throw new IllegalArgumentException("No enum const " + CallDataTables.class + "." + value);
        }
    }
}
